window._MPEOPLE={

    _MAINLABEL:null,

    _ARRTYPE:null,
	
	_CURRENTARR:null,//当前角色列表数组

    _ARRTYPEBACK:1,//替补
    _ARRTYPEFRIEND:2,//友军
    _ARRTYPEARMY:3,//敌军
    _ARRTYPEMIDDLE:4,//中立
    _ARRTYPELATEST:5,//最近

    _PAGESIZE:15,

    _PAGEINDEX:0,

    _TABCONFIG:{
        '1':'alternate01',
        '2':'friend01',
        '3':'enemy01',
        '4':'neutrality01',
        '5':'sanguo01'
    },

    showPeople:function(parentNode,param){

        var uiObj = _GRM.getNodeObj('troops');
        var mainLabel = uiObj.node;

        _MPEOPLE._MAINLABEL = mainLabel;
        _MPEOPLE._PAGEINDEX = 0;
        _MPEOPLE._ARRTYPE = 1;

        if(uiObj.isnew){
            _MPEOPLE.initButton(mainLabel);
        }
        _MPEOPLE.refreshLeft();
        _MPEOPLE.refreshRight();
        parentNode.addChild(mainLabel);
        return mainLabel;

    },
	
	setArrByType:function(type){
        if(type!=_MPEOPLE._ARRTYPELATEST){
            _MPEOPLE._CURRENTARR=_GAMEDATAHELPER.getNpcByType(type);
            _MPEOPLE._CURRENTARR.sort((a,b)=>{
                var lva = _NPC[a]?_NPC[a].lv:0;
                var lvb = _NPC[b]?_NPC[b].lv:0;
                return lvb-lva;
            });
        }else{
            if(_MANAGERROLELABEL._LATESTNPC){
                _MPEOPLE._CURRENTARR=[_MANAGERROLELABEL._LATESTNPC];
            }else{
                _MPEOPLE._CURRENTARR=[];
            }
        }
	},

    getArrByType:function(type){

        return  _MPEOPLE._CURRENTARR;
    },

    refreshRight:function(){
        var pageNode = _MPEOPLE._MAINLABEL.getChildByName('rightLabel').getChildByName('background')
                                .getChildByName('page');
        var tabNode = _MPEOPLE._MAINLABEL.getChildByName('rightLabel').getChildByName('background')
                                .getChildByName('tab')
        var roleNodeArr = _MPEOPLE._MAINLABEL.getChildByName('rightLabel')
                                            .getChildByName('background')
                                            .getChildByName('goods').getChildren();
        
        for(var key in _MPEOPLE._TABCONFIG){
            if(_MPEOPLE._ARRTYPE==key){
                tabNode.getChildByName(_MPEOPLE._TABCONFIG[key]).active = true;
            }else{
                tabNode.getChildByName(_MPEOPLE._TABCONFIG[key]).active = false;
            }
        }

        var startIndex = _MPEOPLE._PAGEINDEX*_MPEOPLE._PAGESIZE;

        var userArr = _MPEOPLE.getArrByType(_MPEOPLE._ARRTYPE);

        //console.log('人物列表',userArr,'起始下标',startIndex,'每页条数',_MPEOPLE._PAGESIZE);

        //var endIndex = startIndex+_MPEOPLE._PAGESIZE;
        for(var i=0;i<_MPEOPLE._PAGESIZE;i++){
            if(_MPEOPLE._ARRTYPE==_MPEOPLE._ARRTYPEBACK){
                _MPEOPLE.refreshRightOne(roleNodeArr[i],window.gameData.playerTeamBack[startIndex+i]);
            }else {
                _MPEOPLE.refreshRightOne(roleNodeArr[i],_NPC[userArr[startIndex+i]]);
            }
        }
        pageNode.getChildByName('label').getComponent(cc.Label).string = "第"+(_MPEOPLE._PAGEINDEX+1)+"页";
    },

    refreshRightOne:function(node,roleInfo){

        if(roleInfo){

            var npctype = roleInfo.npctype;
            var npctypeConfig = _NPC[npctype];
            var npcjob = npctypeConfig.job;
            var npcrace = npctypeConfig.race;
            //var npcqua = npctypeConfig.level;
            var npcqua = _ROLEDATA.getRoleQua(roleInfo);

            node.active = true;

            var lv = roleInfo.lv;
            if(_MPEOPLE._ARRTYPE == _MPEOPLE._ARRTYPEBACK){
                var roleData = _ROLEDATA.getRoleDataOfPlayer(roleInfo);
                lv = roleData.lv;
            }
            var friendData = _GAMEDATAHELPER.getFriendValue(roleInfo.name);

            var faceNode = node.getChildByName('touxian');
            var nameNode = node.getChildByName('name');
            var lvNode = node.getChildByName('lv');
            var ftypeNode = node.getChildByName('ftype');
            var ftypeStrNode = ftypeNode.getChildByName('ftypeStr');
            var lockNode = node.getChildByName('lock');
            if(roleInfo.locked){
                lockNode.active = true;
            }else{
                lockNode.active = false;
            }

            var jobNode = node.getChildByName('job');
            var jobStrNode = jobNode.getChildByName('ftypeStr');
            jobNode.color = new cc.color(window._JOB[npcjob].color);
            jobStrNode.getComponent(cc.Label).string = window._JOB[npcjob].sname;
            var zhongNode = node.getChildByName('zhong');
            var zhongStrNode = zhongNode.getChildByName('ftypeStr');
            zhongNode.color = new cc.color(window._RACE[npcrace].color);
            zhongStrNode.getComponent(cc.Label).string = window._RACE[npcrace].name;
            var quaNode = node.getChildByName('qua');
            var quaStrNode = quaNode.getChildByName('ftypeStr');
            quaNode.color = new cc.color(window._CS.qua[npcqua].color);
            quaStrNode.getComponent(cc.Label).string = npcqua;

            var friendNode = node.getChildByName('friend');
            var friendtitleNode = friendNode.getChildByName('title');

            faceNode.getComponent(cc.Sprite).spriteFrame = _GRM.getFaceFrame(roleInfo.face);
            nameNode.getComponent(cc.Label).string = roleInfo.name;
            lvNode.getComponent(cc.Label).string = "LV."+lv;
            ftypeNode.color = new cc.color(_CS.ftype[roleInfo.ftype].color);
            ftypeStrNode.getComponent(cc.Label).string = roleInfo.ftype;
            friendtitleNode.getComponent(cc.Label).string = "友好:"+friendData;
            friendNode.getChildByName('progress').getComponent(cc.ProgressBar).progress = friendData/100;

            var nodebtns = node.getChildByName('btns');
            var btnUp = nodebtns.getChildByName('buttonUp');
            //var btnInfo=nodebtns.getChildByName('buttonInfo');
            var btnAction=nodebtns.getChildByName('buttonAction');

            if(_MPEOPLE._ARRTYPE == _MPEOPLE._ARRTYPEBACK){
                btnUp.active = true;
              //  btnInfo.active = true;  
                btnAction.active = true; 
            }else{
                btnUp.active = false;
               // btnInfo.active = false;
                btnAction.active = true;   
            }

        }else{

            node.active = false;

        }
        
    },

    refreshLeft:function(){

        var roleNodeArr = _MPEOPLE._MAINLABEL.getChildByName('leftLabel')
                                            .getChildByName('troops')
                                            .getChildByName('troops').getChildren();
        for(var i=0;i<roleNodeArr.length;i++){

            _MPEOPLE.refreshLeftOne(roleNodeArr[i],window.gameData.playerTeam[i]);

        }
    },

    refreshLeftOne:function(node,roleInfo){

        var imgAddNode = node.getChildByName('img_add');
        var informationNode = node.getChildByName('information');
        if(roleInfo){
            var npctype = roleInfo.npctype;
            var npctypeConfig = _NPC[npctype];
            var npcjob = npctypeConfig.job;
            var npcrace = npctypeConfig.race;
            //var npcqua = npctypeConfig.level;
            var npcqua = _ROLEDATA.getRoleQua(roleInfo);

            imgAddNode.active = false;
            informationNode.active = true;

            var faceNode = informationNode.getChildByName('face');
            var barsNode = informationNode.getChildByName('bars');
            var nameNode = faceNode.getChildByName('name');
            var levelNode = faceNode.getChildByName('level');
            var ftypebgNode = faceNode.getChildByName('ftype');
            var ftypeNode = ftypebgNode.getChildByName('ftypeStr');

            var jobbgNode = faceNode.getChildByName('job');
            var jobNode = jobbgNode.getChildByName('ftypeStr');
            jobbgNode.color = new cc.color(window._JOB[npcjob].color);
            jobNode.getComponent(cc.Label).string = window._JOB[npcjob].sname;

            var zhongbgNode = faceNode.getChildByName('zhong');
            var zhongNode = zhongbgNode.getChildByName('ftypeStr');
            zhongbgNode.color = new cc.color(window._RACE[npcrace].color);
            zhongNode.getComponent(cc.Label).string = window._RACE[npcrace].name;

            var quabgNode = faceNode.getChildByName('qua');
            var quaNode = quabgNode.getChildByName('ftypeStr');
            quabgNode.color = new cc.color(window._CS.qua[npcqua].color);
            quaNode.getComponent(cc.Label).string = npcqua;


            var expbarNode = barsNode.getChildByName('exp');
            var exptitleNode = expbarNode.getChildByName('title');
            var hpbarNode = barsNode.getChildByName('hp');
            var hptitleNode = hpbarNode.getChildByName('title');
            var magicbarNode = barsNode.getChildByName('angry');
            var magictitleNode = magicbarNode.getChildByName('title');
            var roleTypeNode = informationNode.getChildByName('roleType');

            var roleData = _ROLEDATA.getRoleDataOfPlayer(roleInfo);
            var maxHp = roleData.maxHp;
            var maxMagic = roleData.maxMagic;
            var expObj = _EXPMANAGER.getNextLevelExp(roleInfo.exp);

            levelNode.getComponent(cc.Label).string = "LV."+roleData.lv;
            nameNode.getComponent(cc.Label).string = roleInfo.name;
            ftypeNode.getComponent(cc.Label).string = roleInfo.ftype;
            faceNode.getComponent(cc.Sprite).spriteFrame = _GRM.getFaceFrame(roleInfo.face);
            exptitleNode.getComponent(cc.Label).string = "经验:"+expObj.cexp+"/"+expObj.nexp;
            hptitleNode.getComponent(cc.Label).string = "生命:"+roleInfo.hp+"/"+maxHp;
            magictitleNode.getComponent(cc.Label).string = "魔法:"+roleInfo.mg+"/"+maxMagic;

            expbarNode.getChildByName('progress').getComponent(cc.ProgressBar).progress = expObj.cexp/expObj.nexp;
            hpbarNode.getChildByName('progress').getComponent(cc.ProgressBar).progress = roleInfo.hp/maxHp;
            magicbarNode.getChildByName('progress').getComponent(cc.ProgressBar).progress = roleInfo.mg/maxMagic;
            ftypebgNode.color = new cc.color(_CS.ftype[roleInfo.ftype].color);


            roleTypeNode.getChildByName('belong').active = false;
            roleTypeNode.getChildByName('custom').active = false;
            roleTypeNode.getChildByName('main').active = false;

            /*
            if(roleInfo.isMainRole){
                roleTypeNode.getChildByName('belong').active = false;
                roleTypeNode.getChildByName('custom').active = false;
                roleTypeNode.getChildByName('main').active = true;
            }else if(roleInfo.isCustomRole){
                roleTypeNode.getChildByName('belong').active = false;
                roleTypeNode.getChildByName('custom').active = true;
                roleTypeNode.getChildByName('main').active = false;
            }else {
                roleTypeNode.getChildByName('belong').active = true;
                roleTypeNode.getChildByName('custom').active = false;
                roleTypeNode.getChildByName('main').active = false;
            }
            */

        }else{
            imgAddNode.active = true;
            informationNode.active = false;
        }

    },

    //赛选角色
    sxByType:function(type){

        if(_MPEOPLE._ARRTYPE!=_MPEOPLE._ARRTYPEBACK){

            _MPEOPLE.setArrByType(_MPEOPLE._ARRTYPE);

            if(_MPEOPLE._CURRENTARR){
                for(var i=0;i<_MPEOPLE._CURRENTARR.length;){
                    var npcname = _MPEOPLE._CURRENTARR[i];
                    if(type=='yn'){
                        if(!_SKILLTEAMHELPER.isImportNpc(npcname)){
                            _MPEOPLE._CURRENTARR.splice(i,1);
                        }else{
                            i++;
                        }
                    }else if(type=='zb'){
                        if(_SHOP[npcname]&&_SHOP[npcname].type=="equip"){
                            i++;
                        }else{
                            _MPEOPLE._CURRENTARR.splice(i,1);
                        }
                    }else if(type=='zzs'){
                        if(_SHOP[npcname]&&_SHOP[npcname].type=="book"){
                            i++;
                        }else{
                            _MPEOPLE._CURRENTARR.splice(i,1);
                        }
                    }else if(type=='dj'){
                        if(_SHOP[npcname]&&_SHOP[npcname].type=="item"){
                            i++;
                        }else{
                            _MPEOPLE._CURRENTARR.splice(i,1);
                        }
                    }else{
                        i++;
                    }
                }
            }

            _MPEOPLE._PAGEINDEX = 0;   
            _MPEOPLE.refreshRight();

        }

    },

    initButton:function(mainLabel){

        var roleNodeArr =mainLabel.getChildByName('leftLabel')
                                    .getChildByName('troops')
                                    .getChildByName('troops').getChildren();
        var roleNodeArrRight = mainLabel.getChildByName('rightLabel')
                                    .getChildByName('background')
                                    .getChildByName('goods').getChildren();
        var btns = mainLabel.getChildByName('rightLabel').getChildByName('btn');
        var tabs = mainLabel.getChildByName('rightLabel').getChildByName('background').getChildByName('tab');
        var btnClose = btns.getChildByName('close');

        var btnSxyn = btns.getChildByName('sxyn');
        var btnSxdj = btns.getChildByName('sxdj');
        var btnSxzzs = btns.getChildByName('sxzzs');
        var btnSxzb = btns.getChildByName('sxzb');

        var tabaltermate = tabs.getChildByName('alternate');
        var tabfriend = tabs.getChildByName('friend');
        var tabenemy = tabs.getChildByName('enemy');
        var tabneutrality = tabs.getChildByName('neutrality');
        var tabsanguo = tabs.getChildByName('sanguo');

        var pageNode = mainLabel.getChildByName('rightLabel').getChildByName('background').getChildByName('page');
        var pageLeftNode = pageNode.getChildByName('btnLeft');
        var pageRightNode = pageNode.getChildByName('btnRight');
        var pageFirstNode = pageNode.getChildByName('first');
        var pageTailNode = pageNode.getChildByName('tail');


        btnClose.on(cc.Node.EventType.TOUCH_START, function(){

            //刷新隐匿
            _MAP.refreshRoleInfo();

            _MAP.refreshMapTeam();
            _GRM.putNode(this);
        }, mainLabel);

        btnSxyn.on(cc.Node.EventType.TOUCH_START, function(){
           //console.log('筛选异能');
           _MPEOPLE.sxByType('yn');
        }, mainLabel);

        btnSxdj.on(cc.Node.EventType.TOUCH_START, function(){
            //console.log('筛选道具');
            //_MPEOPLE.sxByType('dj');

            _CHOICEMANAGER.showChoice(_MAP.node,'fireRole',null);

        }, mainLabel);

        btnSxzzs.on(cc.Node.EventType.TOUCH_START, function(){
            //console.log('筛选制作书');
            _MPEOPLE.sxByType('zzs');
        }, mainLabel);

        btnSxzb.on(cc.Node.EventType.TOUCH_START, function(){
            //console.log('筛选装备');
            _MPEOPLE.sxByType('zb');
        }, mainLabel);

        pageLeftNode.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('左边',0);
            if(_MPEOPLE._PAGEINDEX>0){
                _MPEOPLE._PAGEINDEX--;
                _MPEOPLE.refreshRight();
            }
        }, mainLabel);
        pageRightNode.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('右边',0);
            var userArr = _MPEOPLE._ARRTYPE==_MPEOPLE._ARRTYPEBACK?
                            window.gameData.playerTeamBack:_MPEOPLE.getArrByType(_MPEOPLE._ARRTYPE);
            var lastPage = _CU.getLastPage(userArr.length,_MPEOPLE._PAGESIZE);
            if(_MPEOPLE._PAGEINDEX<lastPage){
                _MPEOPLE._PAGEINDEX++;
                _MPEOPLE.refreshRight();
            }
        }, mainLabel);
        pageFirstNode.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('首页',0);
            if(_MPEOPLE._PAGEINDEX>0){
                _MPEOPLE._PAGEINDEX=0;
                _MPEOPLE.refreshRight();
            }
        }, mainLabel);
        pageTailNode.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('尾页',0);
            var userArr = _MPEOPLE._ARRTYPE==_MPEOPLE._ARRTYPEBACK?
                            window.gameData.playerTeamBack:_MPEOPLE.getArrByType(_MPEOPLE._ARRTYPE);
            _MPEOPLE._PAGEINDEX=_CU.getLastPage(userArr.length,_MPEOPLE._PAGESIZE);
            _MPEOPLE.refreshRight();
        }, mainLabel);

        tabaltermate.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('替补',0);
            _MPEOPLE._ARRTYPE = _MPEOPLE._ARRTYPEBACK;
			//_MPEOPLE.setArrByType(_MPEOPLE._ARRTYPE);
            _MPEOPLE._PAGEINDEX = 0;
            _MPEOPLE.refreshRight();
        }, mainLabel);
        tabfriend.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('友军',0);
            _MPEOPLE._ARRTYPE = _MPEOPLE._ARRTYPEFRIEND;
			_MPEOPLE.setArrByType(_MPEOPLE._ARRTYPE);
            _MPEOPLE._PAGEINDEX = 0;
            _MPEOPLE.refreshRight();
        }, mainLabel);
        tabenemy.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('敌军',0);
            _MPEOPLE._ARRTYPE = _MPEOPLE._ARRTYPEARMY;
			_MPEOPLE.setArrByType(_MPEOPLE._ARRTYPE);
            _MPEOPLE._PAGEINDEX = 0;
            _MPEOPLE.refreshRight();
        }, mainLabel);
        tabneutrality.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('中立',0);
            _MPEOPLE._ARRTYPE = _MPEOPLE._ARRTYPEMIDDLE;
			_MPEOPLE.setArrByType(_MPEOPLE._ARRTYPE);
            _MPEOPLE._PAGEINDEX = 0;
            _MPEOPLE.refreshRight();
        }, mainLabel);

        tabsanguo.on(cc.Node.EventType.TOUCH_START, function(){
            //_TIPS.showMessage('中立',0);
            _MPEOPLE._ARRTYPE = _MPEOPLE._ARRTYPELATEST;
			_MPEOPLE.setArrByType(_MPEOPLE._ARRTYPE);
            _MPEOPLE._PAGEINDEX = 0;
            _MPEOPLE.refreshRight();
        }, mainLabel);

        //正选按钮
        for(var i=0;i<roleNodeArr.length;i++){
            var node = roleNodeArr[i];
            var btnDown = node.getChildByName('information').getChildByName('buttonDown');
            var btnInfo = node.getChildByName('information').getChildByName('face');

            btnDown.nodeIndex = i;
            btnDown.on(cc.Node.EventType.TOUCH_START, function(){
                //_TIPS.showMessage('下阵'+this.nodeIndex,0);

                var role = window.gameData.playerTeam[this.nodeIndex];
                if(role){
                    if(window.gameData.playerTeam.length>1){
                        window.gameData.playerTeam.splice(this.nodeIndex,1);
                        if(!role.isCustomRole){
                            window.gameData.playerTeamBack.unshift(role);
                        }else{
                            var npclog = _GAMEDATAHELPER.getNpcLog(role.name);
                            if(npclog){
                                npclog.diq=0;
                                npclog.gy=0;
                            }
                        }
                        _MPEOPLE.refreshLeft();
                        _MPEOPLE.refreshRight();
                    }else{
                        _TIPS.showMessage('上阵人数不能少于1!',0);
                    }
                }

            }, btnDown);

            btnInfo.nodeIndex = i;
            btnInfo.on(cc.Node.EventType.TOUCH_START, function(){
                //_TIPS.showMessage('详情'+this.nodeIndex,0);

                _MRDL.initUi(_MAP.node,{roleIndex:this.nodeIndex,
                                        sence:_STYPE._TEAMSENCE,
                                        roleArr:window.gameData.playerTeam});

            }, btnInfo);
        }

        //替补按钮
        for(var i=0;i<roleNodeArrRight.length;i++){
            var node = roleNodeArrRight[i];
            var nodebtns = node.getChildByName('btns');
            var btnUp = nodebtns.getChildByName('buttonUp');
            var btnInfo=node.getChildByName('touxian');
            var btnAction=nodebtns.getChildByName('buttonAction');

            btnUp.nodeIndex = i;
            btnUp.on(cc.Node.EventType.TOUCH_START, function(){
                var realIndex = _MPEOPLE._PAGESIZE*_MPEOPLE._PAGEINDEX+this.nodeIndex;
                var role = window.gameData.playerTeamBack[realIndex];
                if(role){
                    var maxlength = _GAMEDATAHELPER.getMaxLengthOfPlayerTeam();
                    if(window.gameData.playerTeam.length<maxlength){
                        window.gameData.playerTeamBack.splice(realIndex,1);
                        window.gameData.playerTeam.push(role);
                        _MPEOPLE.refreshLeft();
                        _MPEOPLE.refreshRight();
                    }else{
                        _TIPS.showMessage('上阵人数不能大于'+maxlength);
                    }
                }
                
            }, btnUp);

            btnInfo.nodeIndex = i;
            btnInfo.on(cc.Node.EventType.TOUCH_START, function(){
                //_TIPS.showMessage('详情'+this.nodeIndex,0);
                if(_MPEOPLE._ARRTYPE==_MPEOPLE._ARRTYPEBACK){
                    var realIndex = _MPEOPLE._PAGESIZE*_MPEOPLE._PAGEINDEX+this.nodeIndex;
                    _MRDL.initUi(_MAP.node,{
                                            roleIndex:realIndex,
                                            sence:_STYPE._TEAMSENCE,
                                            roleArr:window.gameData.playerTeamBack});
                }
            }, btnInfo);

            btnAction.nodeIndex = i;
            //锁定
            btnAction.on(cc.Node.EventType.TOUCH_START, function(){
                
                var realIndex = _MPEOPLE._PAGESIZE*_MPEOPLE._PAGEINDEX+this.nodeIndex;
                var roleInfo = window.gameData.playerTeamBack[realIndex];
                //_CHOICEMANAGER.showChoice(_MAP.node,'fireRole',{realIndex:realIndex});
                if(roleInfo.locked){
                    roleInfo.locked=0;
                }else{
                    roleInfo.locked=1;
                }
                _MPEOPLE.refreshRight();
            }, btnAction);
        }
        

    },


    getFireReward:function(roleInfo){

        var arr = [
                    {type:'plv',value:roleInfo.plv},
                    {type:'ilv',value:roleInfo.ilv},
                    {type:'dlv',value:roleInfo.dlv},
                    {type:'mlv',value:roleInfo.mlv},
                    {type:'hlv',value:roleInfo.hlv}
                    ];
        arr.sort((a,b)=>{
           return b.value-a.value;
        });

        var maxvalue = arr[0];
        var item = "";

        if(maxvalue.type=="plv"){
            item="武力丹";
        }else if(maxvalue.type=="ilv"){
            item="智力丹";
        }else if(maxvalue.type=="hlv"){
            item="体力丹";
        }else if(maxvalue.type=="mlv"){
            item="道德丹";
        }else if(maxvalue.type=="dlv"){
            item="统率丹";
        }

        if(maxvalue.value>=1000){
            item="神级"+item;
        }else if(maxvalue.value>=600){
            item="高级"+item;
        }else if(maxvalue.value>=300){
            item="中级"+item;
        }else{
            item="初级"+item;
        }

        return item;
    },


    fireAll:function(){

        var rewardMap = {};
        var rewardMsg = "解雇成功,获得:";
        for(var i=window.gameData.playerTeamBack.length-1;i>=0;i--){
            var roleInfo = window.gameData.playerTeamBack[i];
            if(!roleInfo.locked){
                var reward = _MPEOPLE.getFireReward(roleInfo);
                if(rewardMap[reward]){
                    rewardMap[reward]++;
                }else{
                    rewardMap[reward]=1;
                }
                window.gameData.playerTeamBack.splice(i,1);
            }
        }
        for(var key in rewardMap){
            var nmb = rewardMap[key];
            var obj = _IOF.createObjByName(key);
            obj.nmb = nmb;
            rewardMsg+=key+"*"+rewardMap[key]+" ";
            _GAMEDATAHELPER.pushItem(obj);
        }

        _TIPS.showMessage(rewardMsg);
        _MPEOPLE.refreshRight();
    }

}